package text_modification;
import java.io.IOException;
import java.io.FileWriter;
import java.io.PrintWriter;

public class WritetoFile {
    private String path;
    private boolean AppendToFile = false;
    
    public WritetoFile(String filepath){
        path = filepath;
    }
    
    public WritetoFile(String filepath, boolean append_value){
        path = filepath;
        AppendToFile = append_value;
    }
    
    public void Writing(String text_line) throws IOException{
        FileWriter write = new FileWriter(path, AppendToFile);
        PrintWriter print_line = new PrintWriter(write);
        print_line.printf("%s" + "%n", text_line);
        print_line.close();
    }
}
